{% load blog_tags keyword_tags i18n future mezzanine_tags %}
{% block blog_recent_posts %}
{% blog_recent_posts 5 as recent_posts %}
{% if recent_posts %}
<div class="widget">

<h5 class="widgetheading">{% trans "Recent Posts" %}</h5>

<ul class="recent">
{% for recent_post in recent_posts %}
<li>
<img class="pull-left" alt="" src="{{ MEDIA_URL }}{% thumbnail recent_post.featured_image 65 65 %}">
<h6><a href="{{ recent_post.get_absolute_url }}"
    >{{ recent_post.title }}</a>
</h6>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endblock %}
{% block blog_categories %}
{% blog_categories as categories %}
{% if categories %}
<div class="widget">
<h5 class="widgetheading">{% trans "Categories" %}</h5>
<ul class="cat">
{% for category in categories %}
<li><a href="{% url "blog_post_list_category" category.slug %}"
    >{{ category }}</a> ({{ category.post_count }})</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endblock %}

{% block blog_keywords %}
{% keywords_for blog.blogpost as tags %}
{% if tags %}
<div class="widget">
<h5 class="widgetheading">{% trans "Tags" %}</h5>

<ul class="tags">
{% for tag in tags %}
<li>
    <a href="{% url "blog_post_list_tag" tag.slug %}"
        class="">{{ tag }} ({{ tag.item_count }})</a>
    
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endblock %}

{% block blog_authors %}
{% blog_authors as authors %}
{% if authors %}
<div class="widget">
<h5 class="widgetheading">{% trans "Authors" %}</h5>

<ul class="cat">
{% for author in authors %}
    <li><a href="{% url "blog_post_list_author" author.username %}"
        >{{ author.get_full_name|default:author.username }} ({{ author.post_count }})</a>
        </li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endblock %}

{% block blog_months %}
{% blog_months as months %}
{% if months %}
<div class="widget">
<h5 class="widgetheading">{% trans "Archive" %}</h5>
{% for month in months %}
    {% ifchanged month.date.year %}
        {% if not forloop.first %}</ul>{% endif %}
       
	<ul class="cat">
    {% endifchanged %}
    <li><a href="{% url "blog_post_list_month" year=month.date.year month=month.date.month %}"
        >{{ month.date|date:"F" }}</a> ({{ month.post_count }})</li>
{% endfor %}
    </ul>
</div>
{% endif %}
{% endblock %}



{% block blog_feeds %}
<div class="widget">
<h5 class="widgetheading">{% trans "Feeds" %}</h5>

{% if tag %}
    <a href="{% url "blog_post_feed_tag" tag.slug "rss" %}">{% trans "RSS" %}</a> /
    <a href="{% url "blog_post_feed_tag" tag.slug "atom" %}">{% trans "Atom" %}</a>
{% endif %}
{% if category %}
    <a href="{% url "blog_post_feed_category" category.slug "rss" %}">{% trans "RSS" %}</a> /
    <a href="{% url "blog_post_feed_category" category.slug "atom" %}">{% trans "Atom" %}</a>
{% endif %}
{% if author %}
    <a href="{% url "blog_post_feed_author" author.username "rss" %}">{% trans "RSS" %}</a> /
    <a href="{% url "blog_post_feed_author" author.username "atom" %}">{% trans "Atom" %}</a>
{% endif %}
{% if not tag and not category and not author %}
    <a href="{% url "blog_post_feed" "rss" %}">{% trans "RSS" %}</a> /
    <a href="{% url "blog_post_feed" "atom" %}">{% trans "Atom" %}</a>
{% endif %}
</div>
{% endblock %}


